<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2018/10/18
 * Time: 09:58
 */

namespace app\api\validate;


use app\lib\exception\WorkMemberException;

class WorkMemberDeleteParameter extends BaseValidate
{
    protected $rule=[
        'userId'=>'require|checkUserIds',
    ];

    protected  function checkUserIds($values){
        if (empty($values)){
            throw new WorkMemberException([
                'code'=>400,
                'msg'=>'删除成员时，成员ID不能为空',
                'error_code'=>44001
            ]);
        }
        if (!is_array($values)){
                throw new WorkMemberException([
                   'msg'=>'参数出错',
                    'error_code'=>44002
                ]);
        }
        return true;
    }
}